package com.ohos.connect.devicecloud.app.modular.projectuser.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ohos.connect.devicecloud.app.modular.projectuser.model.dto.ProjectUserSearchDTO;
import com.ohos.connect.devicecloud.app.modular.projectuser.model.entity.ProjectUser;
import com.ohos.connect.devicecloud.app.modular.projectuser.model.dto.ProjectUserAddDTO;
import com.ohos.connect.devicecloud.app.modular.projectuser.param.ProjectUserEditParam;
import com.ohos.connect.devicecloud.app.modular.projectuser.param.ProjectUserIdParam;
import com.ohos.connect.devicecloud.app.modular.projectuser.param.ProjectUserPageParam;

import java.util.List;

/**
 * APP项目用户Service接口
 *
 * @author Dongtao
 * @date  2024/12/05 11:05
 **/
public interface ProjectUserService extends IService<ProjectUser> {

    // 根据项目id获取用户id
    String getUserIdByProjectId(String projectId);

    /**
     * 获取APP项目用户分页
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     */
    Page<ProjectUser> page(ProjectUserPageParam projectUserPageParam);


    // 根据用户获取项目列表
    List<ProjectUser> getProjectsByAppUserId(ProjectUserSearchDTO projectUserSearchDTO);

    // 根据项目id、当前用户id 获取项目用户
    ProjectUser getProjectUserByProjectId(String projectId);

    /**
     * 添加APP项目用户
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     */
    Boolean add(ProjectUserAddDTO projectUserAddDTO);

    /**
     * 编辑APP项目用户
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     */
    void edit(ProjectUserEditParam projectUserEditParam);

    /**
     * 删除APP项目用户
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     */
    void delete(List<ProjectUserIdParam> projectUserIdParamList);

    /**
     * 获取APP项目用户详情
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     */
    ProjectUser detail(ProjectUserIdParam projectUserIdParam);

    /**
     * 获取APP项目用户详情
     *
     * @author Dongtao
     * @date  2024/12/05 11:05
     **/
    ProjectUser queryEntity(String id);
}
